In a wireless communications network, devices need to transmit information using a frequency resource. The frequency resource is also referred to as a spectrum. The spectrum may be classified into a licensed spectrum and an unlicensed spectrum. The licensed spectrum is a frequency resource exclusive to some operators. The unlicensed spectrum is a common frequency resource in the wireless communications network. With development of communications technologies, an amount of information transmitted in the wireless communications network gradually increases. Preempting the unlicensed spectrum to transmit information may improve a data throughput in the wireless communications network, and better satisfy a user requirement.
In a scenario of preempting the unlicensed spectrum for data transmission, after a device successfully preempts a channel of the unlicensed spectrum, the device may send data at any moment. Consequently, the moment at which the device sends the data may not be a start moment of a complete subframe. That is, the first subframe sent by the device may not be a complete subframe. However, before sending the data, the device needs to perform code modulation on the data, and needs to learn a size of a physical resource. In this case, how to perform code modulation on the incomplete subframe becomes a problem that urgently needs to be resolved.